﻿using Architecture.Domain.Service;
using Architeture.Domain;
using MediatR;
using RBAC.ZhuBoLin.Application.Command.RoleCommand.Slaughter;

namespace RBAC.ZhuBoLin.Application.CommandHandlers.RoleHandler.Slaughter
{
    public class SlaughSelectCommandHandler : IRequestHandler<SlaughSelectCommand, slaughterInfo>
    {
        protected readonly ISlaughterService service;

        public SlaughSelectCommandHandler(ISlaughterService service)
        {
            this.service = service;
        }

        public async Task<slaughterInfo> Handle(SlaughSelectCommand request, CancellationToken cancellationToken)
        {
            return await service.GetSlaughter(request.id);
        }
    }
}
